/*
 * Sketching JavaScript API v0.0b
 *
 */
var skc_sketchWantsOut = false;
var skc_out0 = 0;
var skc_out1 = 0;
var skc_out2 = 0;
var skc_out3 = 0;
function skc_poll() {
    if (skc_sketchWantsOut) {
        skc_sketchWantsOut = false;
        return "" + skc_out0 + "|" + skc_out1 + "|" + skc_out2 + "|" + skc_out3 + "|";
    }
}
function sketchSendIOPack(v0, v1, v2, v3) {
    skc_out0 = skc_prepSendValue(v0);
    skc_out1 = skc_prepSendValue(v1);
    skc_out2 = skc_prepSendValue(v2);
    skc_out3 = skc_prepSendValue(v3);
    skc_sketchWantsOut = true;
}
function skc_prepSendValue(v) {
    v = Number(v);
    if (isNaN(v)) v = 0;
    v = Math.min(255, Math.max(0, v));
    var s = String(v);
    if (s.length == 1) s = "00" + s;
    if (s.length == 2) s = "0" + s;
    return s;
}
